using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UCMessageBox : System.Web.UI.UserControl
{

    override protected void OnInit(EventArgs e)
    {
        InitializeComponent();
        base.OnInit(e);
    }


    public void limpiar()
    {
        Session.Remove(SessionManager.MSGBOX_MENSAJE);
    }


    private void InitializeComponent()
    {
        this.PreRender += new System.EventHandler(this.UCMessageBox_PreRender);

    }

    private void UCMessageBox_PreRender(object sender, System.EventArgs e)
    {
        ArrayList pageMessage = (ArrayList)Session[SessionManager.MSGBOX_MENSAJE];
        if (pageMessage != null)
        {
            dgrdMessages.DataSource = pageMessage;
            dgrdMessages.DataBind();
            //WSession.Remove(SessionManager.MSGBOX_MENSAJE); 
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Page_Unload(object sender, EventArgs e)
    {
        //Session.Remove(SessionManager.MSGBOX_MENSAJE);  
    }
}
